<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title></title>
    <%@ include file="/WEB-INF/views/modules/book/easyui.jsp"%>
</head>
<body>
<div>
    <form id="mainform" action="${ctx}/book/bktype/${action}" method="post">
        <table  class="formTable">
            <tr>
                <td>分类名称：</td>
                <td>
                    <input type="hidden" name="id" value="${id}" data-options="required:false"/>
                    <input name="typDisn" type="text" value="${bkType.typDisn }" class="easyui-validatebox"  data-options="required:true" />
                </td>
            </tr>
            <tr>
                <td>上级分类：</td>
                <td>
                    <input id="pid" name="pid" type="text" value="${bkType.pid }" class="easyui-validatebox" data-options="required:true" />
                </td>
            </tr>
            <tr>
                <td>分类代码：</td>
                <td>
                    <input name="typName" type="text" value="${bkType.typName }" class="easyui-validatebox"  data-options="required:true" />
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">
    $(function(){

        //上级菜单
        $('#pid').combotree({
            width:250,
            method:'GET',
            url: '${ctx}/book/bktype/json',
            idField : 'id',
            textFiled : 'typDisn',
            parentField : 'pid',
            animate:true
        });
        $('#mainform').form({
            onSubmit: function(){
                //var isValid = $(this).form('validate');
                //console.log(isValid);
                //return isValid;	// 返回false终止表单提交
                return true;
            },
            success:function(data){
                if(successTip(data,dg,d))
                    dg.treegrid('reload');
            }
        });
    });

</script>
</body>
</html>